package com.baidu.day05;

public class Student {
    //关键字private的作用：将属性私有化，外部类不能直接访问,需通过getter和setter方法访问
    private String name;
    private Integer age;

    public void setName(String name) {
        if("脏话".equals(name)) {
            this.name = "口口";
        }else {
            this.name = name;
        }
    }

    public String getName() {
        return this.name;
    }
}
